<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AlterOpenShopUserContactAddGuidanceFree extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('open_shop_contract_template', function (Blueprint $table) {
            $table->unsignedInteger('guidanceFee')->default(0)->comment('品牌指导费')->after('decorationDeposit');
            $table->unsignedInteger('version')->default(1)->comment('合同模板版本号')->after('guidanceFee');
        });

        Schema::table('open_shop_user_contract', function (Blueprint $table) {
            $table->unsignedInteger('guidanceFee')->default(0)->comment('品牌指导费')->after('decorationDeposit');
            $table->unsignedInteger('version')->default(1)->comment('合同模板版本号')->after('guidanceFee');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('open_shop_contract_template', function (Blueprint $table) {
            $table->dropColumn('guidanceFee');
            $table->dropColumn('version');
        });

        Schema::table('open_shop_user_contract', function (Blueprint $table) {
            $table->dropColumn('guidanceFee');
            $table->dropColumn('version');
        });
    }
}
